UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zhRt4/M3i6EHs7Rx+1E/Ggg7usu8rkoZQk66ylkqkHg=' 
WHERE 
  key_id = '79825278b202d27c1472fb32a4313a49efb93f6640b77e3017b03726ee2dddc1' 
  AND (
    token = 'zhRt4/M3i6EHs7Rx+1E/Ggg7usu8rkoZQk66ylkqkHg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047