UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1cInyjSg0U0dN+dIoUGSg5X57fNXKRJPTE+0pzSFcGo=' 
WHERE 
  key_id = '310822dff19def66a133df6f6ae1327bc94c08efdf764ab667260b20eb740e02' 
  AND (
    token = '1cInyjSg0U0dN+dIoUGSg5X57fNXKRJPTE+0pzSFcGo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033