UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yD6XTB3EXHE0wxQQAkA8JgfIL/OMB0kiVxhZyDWfXUw='
WHERE
key_id = '03a2aea60ed66159ec8b4d616564771b5d336985751ee9cc8dc850500ddf3eb4'
AND (
token = 'yD6XTB3EXHE0wxQQAkA8JgfIL/OMB0kiVxhZyDWfXUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)