UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O7LKVEYsMtlVwVyS81JyMXZjmABYAt3/GfkouX9qe0Q=' 
WHERE 
  key_id = '33a139e8f48dd3ba45436c0b7dd6c22f3d83cc5392f2908f598d86c521e5aab9' 
  AND (
    token = 'O7LKVEYsMtlVwVyS81JyMXZjmABYAt3/GfkouX9qe0Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035