UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zkw81qITby0fVPzZUWMDHz0Kq4yF7exrWxfAAoeygGc='
WHERE
key_id = '0a4d4b4cd5a2befd7adae91658aa3093929ff9ad04c9b08cb332eeffd6394011'
AND (
token = 'Zkw81qITby0fVPzZUWMDHz0Kq4yF7exrWxfAAoeygGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)