UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U8bLDOHuEG26eP1p+NFs2OOHCQJzmV1TxGbd0q0mKls='
WHERE
key_id = '11f19912b8849d8e114c3a5ca898eb57932bc5873a3faa6f5c4463ebcc8b0f93'
AND (
token = 'U8bLDOHuEG26eP1p+NFs2OOHCQJzmV1TxGbd0q0mKls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)