UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RaF+PJ6KVOedrbWR/ZDKVW1q+EIGyTtG7/CtT075hsA='
WHERE
key_id = '141061731bdd986f912b9a6e89a71d77ff435c76602a43abd11426c4aa24fff6'
AND (
token = 'RaF+PJ6KVOedrbWR/ZDKVW1q+EIGyTtG7/CtT075hsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)