UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8VMDU7j5Ew8jACidPksW8j61o7UjsJTPd4mvV8cBeOo='
WHERE
key_id = '673a477fed04decc29331c16fd2daf168c222e68ecb300546a353ba2168921a3'
AND (
token = '8VMDU7j5Ew8jACidPksW8j61o7UjsJTPd4mvV8cBeOo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)