UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ziB/gaFwNiyI9AIkJwSsJ7fbfV7+3yFhhsMQvlwp/SI='
WHERE
key_id = 'c41d2b86ec41486baadc109d41319f9a53d1c4797de2ec29397e66fee1dc93ef'
AND (
token = 'ziB/gaFwNiyI9AIkJwSsJ7fbfV7+3yFhhsMQvlwp/SI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)