UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jrrKrCvfFAZeWMLU03t0Kx6CHnUjGOUb7hH1iycWUv8='
WHERE
key_id = '93965be51b6b92b240c23bd6f443b1ff71462fb56d9a30685f8ca2e281e54aae'
AND (
token = 'jrrKrCvfFAZeWMLU03t0Kx6CHnUjGOUb7hH1iycWUv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)