UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jUztx+aD05KAGaZMOyIdWYzaZtFYgLkfkHmUYn60Xt4='
WHERE
key_id = '0c2806d839701ffe0d091276882f79452406e62865e867621118879eadce3252'
AND (
token = 'jUztx+aD05KAGaZMOyIdWYzaZtFYgLkfkHmUYn60Xt4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)