UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2a6TDuG/F3DV1ZTBFgiBYxQR5cLT1OtYK6klJpZnaJ8='
WHERE
key_id = 'bfa91cb5b2ef09d549a5221ae69b05cad57300c2f9bbaa064fd1ad96f8985310'
AND (
token = '2a6TDuG/F3DV1ZTBFgiBYxQR5cLT1OtYK6klJpZnaJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)