UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Apd5i6j+//N4RZBCMgZ9ty2g4evOzLDG1i6OJTgaJQ='
WHERE
key_id = '5798de41844db14ec659a2b10714ca1fd5c02936e80a7782e0c9f70eb92c5748'
AND (
token = '2Apd5i6j+//N4RZBCMgZ9ty2g4evOzLDG1i6OJTgaJQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)