UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iyUKbZoGpN4u5rXGx+p+x+ne1wUZr1GINXjTDrwO+fU=' 
WHERE 
  key_id = '2fd9ea704d7dabe43a5b79fb4c7dd0aeb3e3f093e5c859b32da7fceddf9747f4' 
  AND (
    token = 'iyUKbZoGpN4u5rXGx+p+x+ne1wUZr1GINXjTDrwO+fU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028