UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LsH2mciZ1+3l5haIXYytT8a9T2z60Laq7mcb821udPo='
WHERE
key_id = 'e932743960fee9892a9ceee27ce751f06cf75a9880181bc23697a72ebd09548a'
AND (
token = 'LsH2mciZ1+3l5haIXYytT8a9T2z60Laq7mcb821udPo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)