UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vZ2gz/TQZ0zFQQlvRNFLPzBcoW7B0UCme1ratUJj4k4='
WHERE
key_id = '81ab8e5b93704e745a2aa62e7a2c291795f156d6cf6a57c25c1dca52754c64cd'
AND (
token = 'vZ2gz/TQZ0zFQQlvRNFLPzBcoW7B0UCme1ratUJj4k4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)