UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FPQ39BFLWWp4UsbnilfLsP+6GsXQ+Bi/nXgl/RqsaIM='
WHERE
key_id = '0c48a36ad3501a40fc90492273752685cbe0a66ed0f99ce06f39fb8393452c48'
AND (
token = 'FPQ39BFLWWp4UsbnilfLsP+6GsXQ+Bi/nXgl/RqsaIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)