UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sRKOpG/v1KuhcV7qLBhVjAWqN8rM9+oitYqeE1TAOQA=' 
WHERE 
  key_id = '26ddf3e6e77360b1e1931af18689a5e582b4ab325dce83a6fa7aa02cc0b6599d' 
  AND (
    token = 'sRKOpG/v1KuhcV7qLBhVjAWqN8rM9+oitYqeE1TAOQA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044