UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/e1zN5XA4rcLFmCZZqTuqyiY3hZyYfL4T9qjpMW1iWc='
WHERE
key_id = 'e937370bf90bc194d58ebcb1cb5c2e937b485d8760d5aba64f7e3092b82e00f5'
AND (
token = '/e1zN5XA4rcLFmCZZqTuqyiY3hZyYfL4T9qjpMW1iWc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)