UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+9jVMqCM2rbfem43Ah45MLmVQ+/EhLb3CzizK1ncAec='
WHERE
key_id = '1f6ebd286f04c7cc6b20cd0305fddcaf819303421ee6df888e9386d565fcda0b'
AND (
token = '+9jVMqCM2rbfem43Ah45MLmVQ+/EhLb3CzizK1ncAec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)