UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f6XbiReIGOSyhNnlfuKO/VcRLcDaPf7HccjHlZjcrOk=' 
WHERE 
  key_id = '662c7957b08dfefaf0844a7eb0cf4a6b3796f5f32d0e31af52e38bb12db7a582' 
  AND (
    token = 'f6XbiReIGOSyhNnlfuKO/VcRLcDaPf7HccjHlZjcrOk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021