UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3BJ++7yHISx41ICAoRO2rZ1DseEOOY/7hKThJoHSPoc='
WHERE
key_id = 'c55912879f6759eb3074784267e417aac7a815b9eab82b7af64803178be67ac4'
AND (
token = '3BJ++7yHISx41ICAoRO2rZ1DseEOOY/7hKThJoHSPoc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)