UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lcApOR5oaBcQFF0qVstCwquKT/3e0l6A9fJUMXP5AV8=' 
WHERE 
  key_id = 'cf2f311dddc816cce47e27a02aa5b304319c5aaeefaa809c5c94fbbc66c2b47b' 
  AND (
    token = 'lcApOR5oaBcQFF0qVstCwquKT/3e0l6A9fJUMXP5AV8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040