UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GNIVmj/L8GCgTIPPAM/gMVL2n8kjey82GGgqFrQpy0E='
WHERE
key_id = 'f943be8107354d68df011bedf894949c7e6d0703e6ccd1ba3d85c93463b1d232'
AND (
token = 'GNIVmj/L8GCgTIPPAM/gMVL2n8kjey82GGgqFrQpy0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)