UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QbpdX21wY+lhZ2gQRfIzd/V+wDZMkNkv/uC9/wMF2ec='
WHERE
key_id = '57d0e10d63336a66e131e84f735107ce5be8abe80626fc5935dda71152db7a21'
AND (
token = 'QbpdX21wY+lhZ2gQRfIzd/V+wDZMkNkv/uC9/wMF2ec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)