UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WGAqDaIfvaKiuvwphUeh2/se1AbjjFHjRa8EQo+2IpI='
WHERE
key_id = '99bfcce1b85cf6df2c3e30fb0e495822aa9dcdfacb571757a3262619adc5781a'
AND (
token = 'WGAqDaIfvaKiuvwphUeh2/se1AbjjFHjRa8EQo+2IpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)