UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AnZCALomBBckKS4Y//g09pDFqfrd7I2tVqKjUE1mDJE='
WHERE
key_id = 'b0de5b627d1928a71c9ad88bdc62e445096bff3ebdf4fd031a91bc256b0d24ab'
AND (
token = 'AnZCALomBBckKS4Y//g09pDFqfrd7I2tVqKjUE1mDJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)