UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jeCw+mJ1LToE9DdnyjtDsYZMv+iNW4QcUJv+/3376rQ=' 
WHERE 
  key_id = '78ac0b64024b087a996d65eb4726449826414530a696253a2f8c85bd7d10637a' 
  AND (
    token = 'jeCw+mJ1LToE9DdnyjtDsYZMv+iNW4QcUJv+/3376rQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030