UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JIL0OewN6lB93jDGnXLEXWGhBDtZd6DLsUIYdpgDi3Q=' 
WHERE 
  key_id = 'ad01b7bff06551f584b8a8df1ac41c0343665d2bd87063cab0a3504824f3bf0a' 
  AND (
    token = 'JIL0OewN6lB93jDGnXLEXWGhBDtZd6DLsUIYdpgDi3Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031