UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yewkPF8dIAdmeAK5Ipw/ajc/daeTL9xruO9OtT3cZ9s='
WHERE
key_id = 'c1b332238dff93029bcb1c34fd92e5f03b3eefa80ba6c6d9e61d71aabea5c150'
AND (
token = 'yewkPF8dIAdmeAK5Ipw/ajc/daeTL9xruO9OtT3cZ9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)