UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ggZsp9HYCDAURyban+pe2LslvyN9eUUw8Zn9GF2QobM='
WHERE
key_id = '3608df802d42d02543f8266c9ef6a450b6a72d3fad9d0e290f085c22636d62a5'
AND (
token = 'ggZsp9HYCDAURyban+pe2LslvyN9eUUw8Zn9GF2QobM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)