UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZGGkUtZhqa2J2EwO9NUcp1wkE8+QLXIFWthd5yoRaUI='
WHERE
key_id = 'e2d82e43784f13db33076328df5b049ed5cd55708ce61c3b15b0655c95de2288'
AND (
token = 'ZGGkUtZhqa2J2EwO9NUcp1wkE8+QLXIFWthd5yoRaUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)